#ifndef _CT_ADC_H_
#define _CT_ADC_H

// #define CT_CONTINUOUS_MODE

#define CT_ADC_CH0 0
#define CT_ADC_CH1 1
#define CT_ADC_CH2 2
#define CT_ADC_CH3 3
#define CT_ADC_CH4 4
#define CT_ADC_CH5 5
#define CT_ADC_CH6 6
#define CT_ADC_CH7 7
#define CT_VBG     8
// #define CT_VTEMP   9
// #define CT_ADC_CH10 10
// #define CT_ADC_CH11 11
// #define CT_ADC_CH12 12
// #define CT_ADC_CH13 13
// #define CT_ADC_CH14 14
// #define CT_ADC_CH15 15
// #define CT_VLDO 16

#define CT_ADC_ADCDIV1 0
#define CT_ADC_ADCDIV2 1
#define CT_ADC_ADCDIV4 2
#define CT_ADC_ADCDIV8 3

#define CT_ADC_ADCAQT0 0
#define CT_ADC_ADCAQT1 1
#define CT_ADC_ADCAQT2 2
#define CT_ADC_ADCAQT3 3
#define CT_ADC_ADCAQT4 4
#define CT_ADC_ADCAQT5 5
#define CT_ADC_ADCAQT6 6
#define CT_ADC_ADCAQT7 7


/**
 * @brief ADC configuration structure.
 */
typedef struct {
    uint8_t mode;            /**< ADC conversion mode: single or continuous. */
    uint8_t clockDivider;    /**< ADC clock divider value (0-7) for Fadc = Fsys/(2^(clockDivider)). */
    uint8_t AcquisitionTime; /**< ADC acquisition time, calculated as (4*acquisitionTime+10)/Fadc. */
    uint8_t interruptEnable; /**< Enables or disables ADC interrupt (Enable/Disable). */
    uint8_t interruptSource; /**< Selects the ADC interrupt source (ADC_INT_HALFDONE, ADC_INT_CONTDONE, ADC_INT_SINGLE). */
} ADCConfig;



void         ct_adc_Init(void);
void         ct_adc_Open(void);
void         ct_adc_Close(void);
unsigned int ct_adc_SingleRead(unsigned char channel);
unsigned int ct_adc_SingleRead2(unsigned char channel);
#ifdef CT_CONTINUOUS_MODE
unsigned int ct_adc_ContinuousRead(unsigned char channel);
#endif

#endif    // __CT_ADC_H__